package cc.togetherit.jcrawler.parse;

import java.util.Map;

import cc.togetherit.jcrawler.dataPool.CrawlerPool;
import cc.togetherit.jcrawler.fetch.FetchRequest;
import cc.togetherit.jcrawler.parser.SiteParser;


public class ParseEngineFactory {
    public static BaseParseEngine getParseEngine(CrawlerPool<FetchRequest> parsePool, CrawlerPool<Map<String, Object>> persistencePool, ParseConfig parseConfig, SiteParser parser) {
        BaseParseEngine engine = new BaseParseEngine(parsePool, persistencePool, parseConfig, parser);
        engine.setParseEngine(true);
        return engine;
    }
    
    public static BaseParseEngine getPersistenceEngine(CrawlerPool<FetchRequest> parsePool, CrawlerPool<Map<String, Object>> persistencePool, ParseConfig parseConfig, SiteParser parser) {
        BaseParseEngine engine = new BaseParseEngine(parsePool, persistencePool, parseConfig, parser);
        engine.setParseEngine(false);
        return engine;
    }
}
